import qs from 'qs'
import { success } from './index'
import { appTypes, apps } from './models'

export default {
    'get!/appTypes': config => {
        return success(appTypes)
    },
    'get!/apps': config => {
        const { type } = qs.parse(config.url.split('?')[1])
        return success({
            total: 40,
            list: apps.filter(item => item.type === type)
        })
    },
}
